<template>
  <div class="performanceDetailsContainer">
    <!-- 内容 -->
    <index-detail-infos :indexDetailData="indexDetailData" :dimensionId="this.queryParams.dimensionId"></index-detail-infos>
    <div class="explain">
      以上数据仅供参考，最终以年底关账数据为准
    </div>
  </div>
</template>

<script>
import { getAssessmentIndexDetail } from '@/api/home'
import indexDetailInfos from './indexDetailInfos.vue'
import sensormixin from '@/mixins'
export default {
  mixins: [sensormixin],
  data() {
    return {
      showPicker: false,
      /** 请求数据存放 */
      indexDetailData: {},
      queryParams: {
        dimensionId: '',
        institutionValue: ''
      }
    }
  },
  components: {
    indexDetailInfos
  },
  mounted() {
    const { institutionValue, dimensionId } = this.$route.query
    this.queryParams.dimensionId = dimensionId
    this.queryParams.institutionValue = institutionValue
    this.getAssessmentIndexDetail().then(() => {
      try {
        this.openPerformanceCPageForSensor({}, {
          institutionValue: institutionValue,
          dimensionId: dimensionId
        })
      } catch (err) {
        console.log('打开综合考核评分C类页面：', err)
      }
    })
  },
  methods: {
    async getAssessmentIndexDetail() {
      const res = await getAssessmentIndexDetail(this.queryParams)
      this.indexDetailData = res.value
    }
  }
}
</script>

<style lang="scss" scoped>
.performanceDetailsContainer {
  width: 335px;
  margin: 16px auto;
}
.explain {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-bottom: 16px;
}
</style>
